package com.g4m.baselib.fegin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * Created on 2020-01-01
 * <p>Copyright 2008-2020 snsndk.com</p>
 *
 *
 */
@Configuration
public class FeginInterceptorConfig extends WebMvcConfigurationSupport {
    @Autowired
    private FeginRequestInterceptor feginRequestInterceptor;
    @Autowired
    private FeginSecurityInterceptor feginSecurityInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(this.feginRequestInterceptor).addPathPatterns("/**").excludePathPatterns("/actuator/**");
        registry.addInterceptor(this.feginSecurityInterceptor).addPathPatterns("/**").excludePathPatterns("/actuator/**");
        super.addInterceptors(registry);
    }
}
